package com.Mapper;

import java.util.List;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import com.Entity.User;

@Mapper
public interface UserMapper {

	/*查询所有用户*/
	@Select("select name,password from user")
    List<User> selectAll();
	
	/*根据用户名查询用户密码*/
	@Select("select password from user where name= #{name}")
    String selectByName(@Param("name") String name);
	
	/*增加用户*/
	@Insert("INSERT INTO USER(NAME, PASSWORD) VALUES(#{name}, #{password})")
    int insert(@Param("name") String name, @Param("password") String password);

}
